package de.mfr.fragmente;

import android.app.Activity;
import android.app.FragmentManager;
import android.app.ListFragment;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.listenEintraege, android.R.layout.simple_list_item_1); 
		FragmentManager fm = getFragmentManager();
		ListFragment fragmentListe = (ListFragment)fm.findFragmentById(R.id.fragmentListe);
		fragmentListe.setListAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
